/*
*	Copyright (C) 2014  Julio Montes, Mario Carrillo
*
*	Julio Montes e-mail: imc.coder@gmail.com
*
*	Mario Carrillo e-mail: mario_90ago@live.com.mx
*
*	BSD 3-Clause License
*/

#ifndef ALLIANCE_OPTIONCTRL_H
#define ALLIANCE_OPTIONCTRL_H

#include <wx/wx.h>
#include <vector>
#include "alliance/include/toolctrl.h"

#include "sdk/include/filecfg.h"

namespace alliance
{
    class OptionCtrl : public ToolCtrl
    {
    public:
        OptionCtrl( wxWindow *parent, wxWindowID id );

        virtual ~OptionCtrl();

        bool Load( const sdk::mapAttributes &attributes );

        virtual bool IsOk() const;

        const wxString &GetDependencies() const{ return m_dependencies; }

        void AddDependency( OptionCtrl *dependency );

        void CheckDependencies();

        bool IsChecked() const;

        void Checked( bool checked );

        virtual wxString GetText() const;

        virtual void SetText( const wxString &text );
    protected:
    private:
        void OnCheckBox( wxCommandEvent &evt );

        void OnCheckBoxDependency( wxCommandEvent &evt );

        wxCheckBox *m_checkBox;
        wxTextCtrl *m_textCtrl;
        wxComboBox *m_comboBox;
        bool m_empty;
        wxString m_dependencies;
        std::vector<OptionCtrl *> m_vectorDependencies;
    };
}
#endif // ALLIANCE_OPTIONCTRL_H
